package com.dailyblue.java.thread.作业;

import java.util.concurrent.Callable;

public class DemoC2 implements Callable<Integer> {
    private Integer[] array;

    public DemoC2(Integer[] array) {
        this.array = array;
    }

    @Override
    public Integer call() throws Exception {
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        return sum;
    }
}
